<template>
    <div class="container">
        <div class="question-detail">
            <header>
                <router-link to="/">首页 / </router-link>
                <router-link :to="{ path: '/partner/company', query: { id: id }}">企业管理 / </router-link>
                <router-link :to="{ path: '/partner/companyDetail', query: { id: id }}">{{name?name:'--'}}/ </router-link>
                标准化问题清单
            </header>
            <div v-if="messageList.length > 0" class="focus-pointer mb30">
                <div class="flex-box-align" style="padding-left: 18px; position: relative; width: 100%;">
                    今日要事：
                    <div class="message">
                        <ul class="marquee_list" :style="{ top: -num + 'px'}" :class="{marquee_top:num}">
                            <li v-for="(item, index) in messageList" :key="index" v-if="messageList && messageList.length">
                                <router-link :to="{name: item.route}">{{item.showMsg}}</router-link>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
            <el-form  :model="information" :rules="rules" ref="information">
                    <div class="question-wrap" :class="editState?'edit':''">
                        <div class="tabs">
                            <div class="tab" @click="tabClick(index,item.questionYear)" :class="activeIndex == index?'active':''" v-for="(item,index) in yearArr" :key="index">{{returnStr(item.questionYear)}}</div>
                            <div style="float:right;font-size:14px;" class="tip-edit">请根据公司的实际情况，填写下列内容，如果相应条目没有内容，可无需填写。</div>
                        </div>
                        <div class="question-infos">
                            <div  @click="()=>{this.editState = true}" class="edit-btn" v-if="!editState">编辑</div>
                            <div class="infos">
                                <div class="infos-title">资金相关</div>
                                <div class="infos-list">申请金额：
                                    <span  v-if="!editState">{{information.quesCashData?information.quesCashData.applyMoney:''}}</span>
                                    <el-form-item v-if="editState" prop="quesCashData.applyMoney">
                                        <el-input v-model.number="information.quesCashData.applyMoney" placeholder="请输入内容"></el-input>                                        
                                    </el-form-item>
                                    <span style="margin-left:5px;">元</span>
                                </div>
                                <div class="infos-list">申请授信用途：
                                    <span  v-if="!editState">{{information.quesCashData?information.quesCashData.applyUseInfo:''}}</span>
                                    <el-form-item v-if="editState" prop="quesCashData.applyUseInfo">                                    
                                        <el-input v-model="information.quesCashData.applyUseInfo" placeholder="请输入内容"></el-input>
                                    </el-form-item>
                                </div>
                                <div class="infos-list">资金需求说明：
                                    <span  v-if="!editState">{{information.quesCashData?information.quesCashData.moneyRequestInfo:''}}</span>
                                    <el-form-item v-if="editState" prop="quesCashData.moneyRequestInfo">
                                        <el-input v-model="information.quesCashData.moneyRequestInfo" placeholder="请输入内容"></el-input>
                                    </el-form-item>
                                </div>
                                <div class="infos-list">还款来源说明：
                                    <span  v-if="!editState">{{information.quesCashData?information.quesCashData.paymentInfo:''}}</span>
                                    <el-form-item v-if="editState" prop="quesCashData.paymentInfo">
                                        <el-input v-model="information.quesCashData.paymentInfo" placeholder="请输入内容"></el-input>
                                    </el-form-item>
                                </div>
                            </div>
                            <div class="table-list">
                                <div class="table-title">关联企业披露</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">关联企业名称</div>
                                        <div class="col-content" v-for="(item,index) in information.linkCompanyDatas" :key="index">
                                            <span  v-show="!editState">{{item.companyName}}</span>
                                            <el-form-item v-show="editState" :prop="`linkCompanyDatas.${index}.companyName`">
                                                <el-input v-model="item.companyName" size="mini" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">经营范围</div>
                                        <div class="col-content" v-for="(item,index) in information.linkCompanyDatas" :key="index">
                                            <span  v-show="!editState">{{item.businessScope}}</span>
                                            <el-form-item v-show="editState" :prop="`linkCompanyDatas.${index}.businessScope`">
                                                <el-input v-model="item.businessScope" size="mini" placeholder="请输入内容"></el-input>
                                            </el-form-item>                                            
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">关联类型</div>
                                        <div class="col-content" v-for="(item,index) in information.linkCompanyDatas" :key="index">
                                            <span  v-show="!editState">{{item.linkTypeDesc}}</span>
                                            <el-form-item v-show="editState" :prop="`linkCompanyDatas.${index}.linkType`">
                                                <el-select  filterable v-model="item.linkType" size="mini" placeholder="请选择">
                                                    <el-option
                                                        v-for="item in linkArr"
                                                        :key="item.key"
                                                        :label="item.value"
                                                        :value="item.key">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.linkCompanyDatas" :key="index">
                                            <div @click="addBtn" v-if="index == 0"  v-show="editState" class="btn">添加</div>
                                            <div @click="delItem(information.linkCompanyDatas, index)" v-else  v-show="editState" class="btn">删除</div>
                                        </div>
                                    </div>
                                    <!-- <div class="list-names">
                                        <div class="list-name p20">关联企业名称</div>
                                        <div class="list-name p50">经营范围</div>
                                        <div class="list-name p20">关联类型</div>
                                    </div> -->
                                    <!-- <div class="list-info" v-for="(item,index) in information.linkCompanyDatas" :key="index">
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.companyName}}</span>
                                            <el-form-item v-show="editState" :prop="`linkCompanyDatas.${index}.companyName`">
                                                <el-input v-model="item.companyName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p50">
                                            <span  v-show="!editState">{{item.businessScope}}</span>
                                            <el-form-item v-show="editState" :prop="`linkCompanyDatas.${index}.businessScope`">
                                                <el-input v-model="item.businessScope" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.linkTypeDesc}}</span>
                                            <el-form-item v-show="editState" :prop="`linkCompanyDatas.${index}.linkType`">
                                                <el-select v-model="item.linkType" placeholder="请选择">
                                                    <el-option
                                                    v-for="item in linkArr"
                                                    :key="item.key"
                                                    :label="item.value"
                                                    :value="item.key">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </div>
                                    </div> -->
                                    <!-- <div @click="addBtn"  v-show="editState" class="btn">添加</div> -->
                                </div>
                            </div>
                            <div class="table-list">
                                <div class="table-title">主营构成</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">主营产品及服务名称</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                            <span  v-show="!editState">{{item.productName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.productName`">
                                                <el-input v-model="item.productName" size="mini" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">上一年营业收入(元)</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                            <span  v-show="!editState">{{item.lastYearIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.lastYearIncome`">
                                                <el-input v-model.number="item.lastYearIncome" size="mini" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">上一年占总营业收入%</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                            <span  v-show="!editState">{{item.lastYearIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.lastYearIncomeRate`">
                                                <el-input v-model.number="item.lastYearIncomeRate" size="mini" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">本年预估营业收入(元)</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                            <span  v-show="!editState">{{item.thisYearIncome }}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.thisYearIncome`">
                                                <el-input v-show="editState" size="mini" v-model="item.thisYearIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">本年预估占总营业收入%</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                            <span  v-show="!editState">{{item.thisYearIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.thisYearIncomeRate`">
                                                <el-input v-show="editState" size="mini" v-model="item.thisYearIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                            <div @click="addBtn1" v-show="editState" v-if="index == 0" class="btn">添加</div>
                                            <div @click="delItem(information.mainCompositionDatas, index)" v-show="editState" v-else class="btn">删除</div>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p18">主营产品及服务名称</div>
                                        <div class="list-name p18">上一年营业收入(元)</div>
                                        <div class="list-name p18">上一年占总营业收入%</div>
                                        <div class="list-name p18">本年预估营业收入(元)</div>
                                        <div class="list-name p18">本年预估占总营业收入%</div>
                                    </div>
                                    <div class="list-info"  v-for="(item,index) in information.mainCompositionDatas" :key="index">
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.productName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.productName`"
                                                :rules="{
                                                    required: true, message: '主营产品及服务名称不能为空'
                                                }">
                                                <el-input v-model="item.productName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.lastYearIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.lastYearIncome`"
                                                :rules="{
                                                    validator: validateNum
                                                }">
                                                <el-input v-model.number="item.lastYearIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.lastYearIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.lastYearIncomeRate`"
                                                :rules="{
                                                    validator: validateRate
                                                }">
                                                <el-input v-model.number="item.lastYearIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.thisYearIncome }}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.thisYearIncome`"
                                                :rules="{
                                                    validator: validateNum
                                                }">
                                                <el-input v-show="editState" v-model="item.thisYearIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.thisYearIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCompositionDatas.${index}.thisYearIncomeRate`"
                                                :rules="{
                                                    validator: validateRate
                                                }">
                                                <el-input v-show="editState" v-model="item.thisYearIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn1" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <div class="table-list">
                                <div class="table-title">公司最近一年内签订的主要销售合同或订单情况</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">签订时间</div>
                                        <div class="col-content" v-for="(item,index) in information.mainOrderDatas" :key="index">
                                            <span  v-show="!editState">{{item.signTime?item.signTime.split(' ')[0]:''}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.signTime`">
                                                <el-date-picker size="mini"
                                                    style="width: 160px;"
                                                    v-model="item.signTime"
                                                    type="date"
                                                    placeholder="选择日期"
                                                    format="yyyy 年 MM 月 dd 日"
                                                    value-format="yyyy-MM-dd">
                                                </el-date-picker>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">购方名称</div>
                                        <div class="col-content" v-for="(item,index) in information.mainOrderDatas" :key="index">
                                            <span  v-show="!editState">{{item.buyerName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.buyerName`">
                                                <el-input size="mini" v-model="item.buyerName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">合同金额（元）</div>
                                        <div class="col-content" v-for="(item,index) in information.mainOrderDatas" :key="index">
                                            <span  v-show="!editState">{{item.contractPrice}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.contractPrice`">
                                                <el-input size="mini" v-model.number="item.contractPrice" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">备注</div>
                                        <div class="col-content" v-for="(item,index) in information.mainOrderDatas" :key="index">
                                            <span  v-show="!editState">{{item.memo}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.memo`">
                                                <el-input size="mini" v-model="item.memo" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.mainOrderDatas" :key="index">
                                            <div @click="addBtn2" v-if="index == 0" v-show="editState" class="btn">添加</div>
                                            <div @click="delItem(information.mainOrderDatas, index)" v-else v-show="editState" class="btn">删除</div>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p18">签订时间</div>
                                        <div class="list-name p18">购方名称</div>
                                        <div class="list-name p18">合同金额（元）</div>
                                        <div class="list-name p18">备注</div>
                                    </div>
                                    <div class="list-info"  v-for="(item,index) in information.mainOrderDatas" :key="index">
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.signTime?item.signTime.split(' ')[0]:''}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.signTime`"
                                                :rules="{
                                                    required: true, message: '日期不能为空'
                                                }">
                                                <el-date-picker
                                                    v-model="item.signTime"
                                                    type="date"
                                                    placeholder="选择日期"
                                                    format="yyyy 年 MM 月 dd 日"
                                                    value-format="yyyy-MM-dd">
                                                </el-date-picker>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.buyerName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.buyerName`"
                                                :rules="{
                                                    required: true, message: '购方名称不能为空'
                                                }">
                                                <el-input v-model="item.buyerName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.contractPrice}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.contractPrice`"
                                                :rules="{
                                                    validator: validateNum
                                                }">
                                                <el-input v-model.number="item.contractPrice" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.memo}}</span>
                                            <el-form-item v-show="editState" :prop="`mainOrderDatas.${index}.memo`">
                                                <el-input v-model="item.memo" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn2" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <div class="table-list">
                                <div class="table-title">前五大客户情况</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">客户名称</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                            <span  v-show="!editState">{{item.customerName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.customerName`">
                                                <el-input size="mini" v-model="item.customerName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">销售商品或服务名称</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                            <span  v-show="!editState">{{item.productName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.productName`">
                                                <el-input size="mini" v-show="editState" v-model="item.productName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">上一年销售金额(元)</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                            <span  v-show="!editState">{{item.lastSalesIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.lastSalesIncome`">
                                                <el-input size="mini" v-show="editState" v-model="item.lastSalesIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">上一年销售金额占比%</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                            <span  v-show="!editState">{{item.lastSalesIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.lastSalesIncomeRate`">
                                                <el-input size="mini" v-show="editState" v-model="item.lastSalesIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">本年预估销售金额(元)</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                            <span  v-show="!editState">{{item.thisSalesIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.thisSalesIncome`">
                                                <el-input size="mini" v-show="editState" v-model="item.thisSalesIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                            <div @click="addBtn3" v-if="index == 0" v-show="editState" class="btn">添加</div>
                                            <div @click="delItem(information.mainCustomerDatas, index)" v-else v-show="editState" class="btn">删除</div>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p18">客户名称</div>
                                        <div class="list-name p18">销售商品或服务名称</div>
                                        <div class="list-name p18">上一年销售金额(元)</div>
                                        <div class="list-name p18">上一年销售金额占比%</div>
                                        <div class="list-name p18">本年预估销售金额(元)</div>
                                    </div>
                                    <div class="list-info" v-for="(item,index) in information.mainCustomerDatas" :key="index">
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.customerName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.customerName`"
                                                :rules="{
                                                    required: true, message: '客户名称不能为空'
                                                }">
                                                <el-input v-model="item.customerName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.productName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.productName`"
                                                :rules="{
                                                    required: true, message: '销售商品或服务名称不能为空'
                                                }">
                                                <el-input v-show="editState" v-model="item.productName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.lastSalesIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.lastSalesIncome`"
                                                :rules="{
                                                    validator: validateNum
                                                }">
                                                <el-input v-show="editState" v-model="item.lastSalesIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.lastSalesIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.lastSalesIncomeRate`"
                                                :rules="{
                                                    validator: validateRate
                                                }">
                                                <el-input v-show="editState" v-model="item.lastSalesIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.thisSalesIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainCustomerDatas.${index}.thisSalesIncome`"
                                                :rules="{
                                                    validator: validateNum
                                                }">
                                                <el-input v-show="editState" v-model="item.thisSalesIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn3" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <div class="table-list">
                                <div class="table-title">前五大供应商情况</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">供应商名称</div>
                                        <div class="col-content" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                            <span  v-show="!editState">{{item.supplierName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.supplierName`">
                                                <el-input size="mini" v-show="editState" v-model="item.supplierName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">采购商品或服务名称</div>
                                        <div class="col-content" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                            <span  v-show="!editState">{{item.productName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.productName`">
                                                <el-input size="mini" v-model="item.productName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">上一年销售金额(元)</div>
                                        <div class="col-content" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                            <span  v-show="!editState">{{item.lastSupplyIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.lastSupplyIncome`">
                                                <el-input size="mini" v-show="editState" v-model="item.lastSupplyIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">上一年销售金额占比%</div>
                                        <div class="col-content" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                            <span  v-show="!editState">{{item.lastSupplyIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.lastSupplyIncomeRate`">
                                                <el-input size="mini" v-show="editState" v-model="item.lastSupplyIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">本年预估销售金额(元)</div>
                                        <div class="col-content" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                            <span  v-show="!editState">{{item.thisSupplyIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.thisSupplyIncome`">                                            
                                                <el-input size="mini" v-show="editState" v-model="item.thisSupplyIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                            <div @click="addBtn4" v-if="index == 0" v-show="editState" class="btn">添加</div>
                                            <div @click="delItem(information.mainSupplierDatas, index)" v-else v-show="editState" class="btn">删除</div>                                            
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p18">供应商名称</div>
                                        <div class="list-name p18">采购商品或服务名称</div>
                                        <div class="list-name p18">上一年销售金额(元)</div>
                                        <div class="list-name p18">上一年销售金额占比%</div>
                                        <div class="list-name p18">本年预估销售金额(元)</div>
                                    </div>
                                    <div class="list-info" v-for="(item,index) in information.mainSupplierDatas" :key="index">
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.supplierName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.supplierName`"
                                                :rules="{
                                                    required: true,
                                                    message: '供应商名称不能为空'
                                                }">
                                                <el-input v-show="editState" v-model="item.supplierName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.productName}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.productName`"
                                                :rules="{
                                                    required: true,
                                                    message: '采购商品或服务名称不能为空'
                                                }">
                                                <el-input v-model="item.productName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.lastSupplyIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.lastSupplyIncome`"
                                                :rules="{
                                                    validator: validateNum
                                                }">
                                                <el-input v-show="editState" v-model="item.lastSupplyIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.lastSupplyIncomeRate}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.lastSupplyIncomeRate`"
                                                :rules="{
                                                    validator: validateRate
                                                }">
                                                <el-input v-show="editState" v-model="item.lastSupplyIncomeRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p18">
                                            <span  v-show="!editState">{{item.thisSupplyIncome}}</span>
                                            <el-form-item v-show="editState" :prop="`mainSupplierDatas.${index}.thisSupplyIncome`"
                                                :rules="{
                                                    validator: validateNum
                                                }">                                            
                                                <el-input v-show="editState" v-model="item.thisSupplyIncome" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn4" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <div class="table-list">
                                <div class="table-title">企业银行融资情况（如有）</div>
                                <div class="list-wrapper">
                                    <div class="list-col" style="width: 170px; flex: none;">
                                        <div class="col-header">银行名称</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.bankName}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.bankId`">
                                                <el-select  style="width: 150px;" size="mini" v-model="item.bankId" filterable  :loading="loanLoading" clearable placeholder="请选择">
                                                    <el-option
                                                        v-for="item in bankArr"
                                                        :key="item.key"
                                                        :label="item.value"
                                                        :value="item.key">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">贷款产品</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.loanProductName}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.loanProductName`">
                                                <el-input style="width: 110px;" size="mini" v-show="editState" v-model="item.loanProductName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">授信额度</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.creditLine}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.creditLine`">
                                                <el-input style="width: 110px;" size="mini" v-show="editState" v-model.number="item.creditLine" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">贷款金额</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.loanMoney}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.loanMoney`">
                                                <el-input style="width: 110px;" size="mini" v-show="editState" v-model="item.loanMoney" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">贷款利率</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.loanRate}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.loanRate`">
                                                <el-input style="width: 110px;" size="mini" v-show="editState" v-model="item.loanRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col" style="flex: 1.2">
                                        <div class="col-header">起止日期</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.rangeTime}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.rangeTime`">
                                                <el-input style="width: 150px;" size="mini" v-show="editState" v-model="item.rangeTime" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">担保方式</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <span  v-show="!editState">{{item.graranteeMethodDesc || ''}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.guaranteeMethod`">
                                                <el-select filterable style="width: 110px;" size="mini" v-model="item.guaranteeMethod" clearable placeholder="请选择">
                                                    <el-option
                                                        v-for="item in guarantArr"
                                                        :key="item.key"
                                                        :label="item.value"
                                                        :value="item.key">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                            <div @click="addBtn5" v-if="index == 0" v-show="editState" class="btn">添加</div>
                                            <div @click="delItem(information.businessFinanceDatas, index)" v-else v-show="editState" class="btn">删除</div>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p20">银行名称</div>
                                        <div class="list-name p20">贷款产品</div>
                                        <div class="list-name p10">授信额度</div>
                                        <div class="list-name p10">贷款金额</div>
                                        <div class="list-name p10">贷款利率</div>
                                        <div class="list-name p10">起止日期</div>
                                        <div class="list-name p10">担保方式</div>
                                    </div>
                                    <div class="list-info" v-for="(item,index) in information.businessFinanceDatas" :key="index">
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.bankName}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.bankId`">
                                                <el-select v-model="item.bankId" filterable  :loading="loanLoading" clearable placeholder="请选择">
                                                    <el-option
                                                    v-for="item in bankArr"
                                                    :key="item.key"
                                                    :label="item.value"
                                                    :value="item.key">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.loanProductName}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.loanProductName`">
                                                <el-input v-show="editState" v-model="item.loanProductName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p10">
                                            <span  v-show="!editState">{{item.creditLine}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.creditLine`">
                                                <el-input v-show="editState" v-model.number="item.creditLine" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p10">
                                            <span  v-show="!editState">{{item.loanMoney}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.loanMoney`">
                                                <el-input v-show="editState" v-model="item.loanMoney" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p10">
                                            <span  v-show="!editState">{{item.loanRate}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.loanRate`">
                                                <el-input v-show="editState" v-model="item.loanRate" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p10">
                                            <span  v-show="!editState">{{item.rangeTime}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.rangeTime`">
                                                <el-input v-show="editState" v-model="item.rangeTime" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p10">
                                            <span  v-show="!editState">{{item.gradranteeMethodDesc}}</span>
                                            <el-form-item v-show="editState" :prop="`businessFinanceDatas.${index}.guaranteeMethod`">
                                                <el-select v-model="item.guaranteeMethod" clearable placeholder="请选择">
                                                    <el-option
                                                    v-for="item in guarantArr"
                                                    :key="item.key"
                                                    :label="item.value"
                                                    :value="item.key">
                                                    </el-option>
                                                </el-select>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn5" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <div class="table-list">
                                <div class="table-title">企业开户情况</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">开户行</div>
                                        <div class="col-content" v-for="(item,index) in information.bankAccountDatas" :key="index">
                                            <span  v-show="!editState">{{item.bankName}}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.bankName`">
                                                <el-input size="mini" v-model="item.bankName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">币别</div>
                                        <div class="col-content" v-for="(item,index) in information.bankAccountDatas" :key="index">
                                            <span  v-show="!editState">{{item.currency }}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.currency`">
                                                <el-input size="mini" v-show="editState" v-model="item.currency" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">账号</div>
                                        <div class="col-content" v-for="(item,index) in information.bankAccountDatas" :key="index">
                                            <span  v-show="!editState">{{item.account}}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.account`">
                                                <el-input size="mini" v-model="item.account" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">是否主结算行</div>
                                        <div class="col-content" v-for="(item,index) in information.bankAccountDatas" :key="index">
                                            <span  v-show="!editState">{{item.isMaster}}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.isMaster`">
                                                <el-input size="mini" v-show="editState" v-model="item.isMaster" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.bankAccountDatas" :key="index">
                                            <div v-if="index == 0" @click="addBtn6" v-show="editState" class="btn">添加</div>
                                            <div v-else @click="delItem(information.bankAccountDatas, index)" v-show="editState" class="btn">删除</div>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p20">开户行</div>
                                        <div class="list-name p20">币别</div>
                                        <div class="list-name p20">账号</div>
                                        <div class="list-name p20">是否主结算行</div>
                                    </div>
                                    <div class="list-info" v-for="(item,index) in information.bankAccountDatas" :key="index">
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.bankName}}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.bankName`"
                                                :rules="{
                                                    required: true,
                                                    message: '开户行不能为空'                                             
                                                }">
                                                <el-input v-model="item.bankName" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.currency }}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.currency`"
                                                :rules="{
                                                    required: true,
                                                    message: '币别不能为空'                                             
                                                }">
                                                <el-input v-show="editState" v-model="item.currency" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.account}}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.account`"
                                                :rules="{
                                                    required: true,
                                                    message: '账号不能为空'                                             
                                                }">
                                                <el-input v-model="item.account" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.isMaster}}</span>
                                            <el-form-item v-show="editState" :prop="`bankAccountDatas.${index}.isMaster`"
                                                :rules="{
                                                    validator: validatorYesOrNo                               
                                                }">
                                                <el-input v-show="editState" v-model="item.isMaster" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn6" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <div class="table-list">
                                <div class="table-title">客户资产明细</div>
                                <div class="list-wrapper">
                                    <div class="list-col">
                                        <div class="col-header">资产类型</div>
                                        <div class="col-content" v-for="(item,index) in information.assetDetailDatas" :key="index">
                                            <span  v-show="!editState">{{item.assetType}}</span>
                                            <el-form-item v-show="editState" :prop="`assetDetailDatas.${index}.assetType`">
                                                <el-input size="mini" v-model="item.assetType" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">资产明细</div>
                                        <div class="col-content" v-for="(item,index) in information.assetDetailDatas" :key="index">
                                            <span  v-show="!editState">{{item.assetDetail}}</span>
                                            <el-form-item v-show="editState" :prop="`assetDetailDatas.${index}.assetDetail`">
                                                <el-input size="mini" v-model="item.assetDetail" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col">
                                        <div class="col-header">权利人</div>
                                        <div class="col-content" v-for="(item,index) in information.assetDetailDatas" :key="index">
                                            <span  v-show="!editState">{{item.owner}}</span>
                                            <el-form-item v-show="editState" :prop="`assetDetailDatas.${index}.owner`">
                                                <el-input size="mini" v-model="item.owner" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div class="list-col op" v-show="editState">
                                        <div class="col-header">操作</div>
                                        <div class="col-content" v-for="(item,index) in information.assetDetailDatas" :key="index">
                                            <div @click="addBtn7" v-if="index == 0" v-show="editState" class="btn">添加</div>
                                            <div @click="delItem(information.assetDetailDatas, index)" v-else v-show="editState" class="btn">删除</div>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="list-wrap">
                                    <div class="list-names">
                                        <div class="list-name p20">资产类型</div>
                                        <div class="list-name p30">资产明细</div>
                                        <div class="list-name p20">权利人</div>
                                    </div>
                                    <div class="list-info"  v-for="(item,index) in information.assetDetailDatas" :key="index">
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.assetType}}</span>
                                            <el-form-item v-show="editState" :prop="`assetDetailDatas.${index}.assetType`">
                                                <el-input v-model="item.assetType" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p30">
                                            <span  v-show="!editState">{{item.assetDetail}}</span>
                                            <el-form-item v-show="editState" :prop="`assetDetailDatas.${index}.assetDetail`">
                                                <el-input v-model="item.assetDetail" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                        <div class="list-value p20">
                                            <span  v-show="!editState">{{item.owner}}</span>
                                            <el-form-item v-show="editState" :prop="`assetDetailDatas.${index}.owner`">
                                            <el-input v-model="item.owner" placeholder="请输入内容"></el-input>
                                            </el-form-item>
                                        </div>
                                    </div>
                                    <div @click="addBtn7" v-show="editState" class="btn">添加</div>
                                </div> -->
                            </div>
                            <el-button v-show="editState"  style="margin: 20px 40%;" :loading="btnState"   type="primary" @click="submitBtn">{{btnState?'保存中':'保存'}}</el-button>
                        </div>
                    </div>
                </el-form>
        </div>
    </div>
</template>
<script>
let CONSTANT = require('../../constant/constant.js'),
    common = require('../../common.js');
import VueRouter from 'vue-router'
const validateNum =  (rule, value, callback) => {
    if (isNaN(value) || value === '') { 
        console.log(value);
        return callback(new Error('请输入数字')); 
    }
    var reg= /^(-?\d+)(\.\d{1,2})?$/
    if (!reg.test(value)){ return callback(new Error('请保留两位小数')); }
    callback();
}
const validateRate = (rule, value, callback) => {
    if (isNaN(value) || value === '') return callback(new Error('请输入比率'))
    if (value > 100 || value < 0) {
        return callback(new Error('请输入1-100之间的比率'))
    }
    callback()
}
const validatorYesOrNo = (rule, value, callback) => {
    if (value == '是' || value == '否') {
        callback()
    } else {
        return callback(new Error('请输入是或者否'))        
    }
}
export default {
  data(){
    return{
      id:'',
      name:'',
      activeIndex:0,
      btnState:false,
      editState:false,
      rules: {
        //   "quesCashData.applyMoney": [
        //       {
        //           validator: validateNum
        //       }
        //   ],
        //   "quesCashData.applyUseInfo": [
        //       {
        //           required: true,
        //           message: '申请授信用途不能为空'
        //       }
        //   ],
        //   "quesCashData.moneyRequestInfo": [
        //       {
        //           required: true,
        //           message: '资金需求说明不能为空'
        //       }
        //   ],
        //   "quesCashData.paymentInfo": [
        //       {
        //           required: true,
        //           message: '还款来源说明不能为空'          
        //       }
        //   ]
      },
      information:{
        assetDetailDatas: [{
            assetDetail: "",
            assetType: "",
            owner: "",
        }],
        bankAccountDatas: [{
            account: "",
            bankName: "",
            currency: "",
            isMaster: ""
        }],
        businessFinanceDatas: [{
            bankId: "",
            creditLine: '',
            guaranteeMethod: "",
            loanMoney: '',
            loanProductName: "",
            loanRate: '',
            rangeTime: "",
        }],
        linkCompanyDatas: [{
            businessScope:"",
            companyName:"",
            linkType: ""
        }],
        mainCompositionDatas: [{
            lastYearIncome:  "",
            lastYearIncomeRate:  "",
            productName: "",
            questionYear: "",
            thisYearIncome:  "",
            thisYearIncomeRate:  "",
        }],
        mainCustomerDatas: [
            {
                customerName: "",
                lastSalesIncome: "",
                lastSalesIncomeRate: "",
                productName: "",
                thisSalesIncome: ""
            }
        ],
        mainOrderDatas: [
          {
            buyerName: "",
            contractPrice: '',
            memo: "",
            signTime: "",
          }
        ],
        mainSupplierDatas: [
            {
                lastSupplyIncome:'',
                lastSupplyIncomeRate: '',
                productName: "",
                supplierName: "",
                thisSupplyIncome: ''
            }
        ],
        quesCashData: {
            applyMoney: '',
            applyUseInfo: "",
            moneyRequestInfo: "",
            paymentInfo: ""
        },
        questionYear: ''
      },
      questionYear:'',
      yearSelectArr:[
          {
              key:'201501',
              value:'2015年上半年'
          },
          {
              key:'201502',
              value:'2015年下半年'
          },
          {
              key:'201601',
              value:'2016年上半年'
          },
          {
              key:'201602',
              value:'2016年下半年'
          },
          {
              key:'201701',
              value:'2017年上半年'
          },
          {
              key:'201702',
              value:'2017年下半年'
          },
          {
              key:'201801',
              value:'2018年上半年'
          },
          {
              key:'201802',
              value:'2018年下半年'
          },
          {
              key:'201901',
              value:'2019年上半年'
          },
          {
              key:'201902',
              value:'2019年下半年'
          },
          {
              key:'202001',
              value:'2020年上半年'
          },
          {
              key:'202002',
              value:'2020年下半年'
          },
          {
              key:'202101',
              value:'2021年上半年'
          },
          {
              key:'202102',
              value:'2021年下半年'
          },
          {
              key:'202201',
              value:'2022年上半年'
          },
          {
              key:'202202',
              value:'2022年下半年'
          },
          {
              key:'202301',
              value:'2023年上半年'
          },
          {
              key:'202302',
              value:'2023年下半年'
          }
      ],
      yearArr:[],
      linkArr:[],
      bankArr:[],
      loanLoading:true,
      guarantArr:[],
        num: 0,
        messageList: []
    }
  },
  components: {

  },  
  mounted(){
      this.id = this.$router.currentRoute.query.id;
      this.name = this.$router.currentRoute.query.name;
      this.information.userId = this.id
      this.getYearList()
      this.getLinkArr()
      this.getBankArr()
      this.getGuarantArr()
      this.getMessage()
      setInterval( () => {
          this.getMessage()
      }, 120000)
  },
  methods:{
      getMessage() {
          let url = CONSTANT.URL.CALENDAR.MESSAGELIST;
          common.requestAjax(url, {}, {}, (data) => {
              if(data.status == 200) {
                  this.messageList = data.data.bussData;
                  this.showMarquee(this.num)
              }
          })
      },
      validateNum,
      validateRate,
      validatorYesOrNo,
      delItem(arr, index) {
          arr.splice(index, 1)
      },
      addBtn(){
          this.information.linkCompanyDatas.push({
              businessScope:"",
              companyName:"",
              linkType: ""
          })
      },
      addBtn1(){
          this.information.mainCompositionDatas.push({
            lastYearIncome:  "",
            lastYearIncomeRate:  "",
            productName: "",
            questionYear: "",
            thisYearIncome:  "",
            thisYearIncomeRate:  "",
        })
      },
      addBtn2(){
          this.information.mainOrderDatas.push({
            buyerName: "",
            contractPrice: '',
            memo: "",
            signTime: "",
          })
      },
      addBtn3(){
        this.information.mainCustomerDatas.push({
            customerName: "",
            lastSalesIncome: "",
            lastSalesIncomeRate: "",
            productName: "",
            thisSalesIncome: ""
        })
      },
      addBtn4(){
        this.information.mainSupplierDatas.push({
            lastSupplyIncome:'',
            lastSupplyIncomeRate: '',
            productName: "",
            supplierName: "",
            thisSupplyIncome: ''
        })
      },
      addBtn5(){
        this.information.businessFinanceDatas.push({
            bankId: "",
            creditLine: '',
            guaranteeMethod: "",
            loanMoney: '',
            loanProductName: "",
            loanRate: '',
            rangeTime: "",
        })
      },
      addBtn6(){
        this.information.bankAccountDatas.push({
            account: "",
            bankName: "",
            currency: "",
            isMaster: ""
        })
      },
      addBtn7(){
        this.information.assetDetailDatas.push({
            assetDetail: "",
            assetType: "",
            owner: "",
        })
      },
      submitBtn(){
          this.information.userId = this.id
          this.$refs.information.validate((valid) => {
            if (valid) {
                let url = CONSTANT.URL.COMPANY.SAVEUSERQUESTION;
                let param = JSON.stringify(this.information);
                this.btnState = true;
                common.requestAjax(url, param, null, res => {
                    if(res.status == 200) {
                        this.$message({
                            type: 'success',
                            message: '保存成功!'
                        });
                        this.btnState = false;
                        this.editState = false;
                        this.getDetail()
                    } else {
                        this.btnState = false;
                        this.$message({
                            type: 'error',
                            message: res.msg
                        });
                    }
                });
            }
        })
        
      },
      getDetail(){
            let  url = CONSTANT.URL.COMPANY.FINDUSERDETAIL,
                data = {questionYear:this.questionYear,userId:this.id},
                dataForm = {}
                common.requestAjax(url,JSON.stringify(data),dataForm,(res)=>{
                if(res.status == 200){
                    let obj = this.information.assetDetailDatas
                    let info = res.data.bussData;
                    if(!info.assetDetailDatas.length){
                        info.assetDetailDatas = [{
                            assetDetail: "",
                            assetType: "",
                            owner: "",
                        }]
                    }
                    if(!info.bankAccountDatas.length){
                        info.bankAccountDatas = [{
                            account: "",
                            bankName: "",
                            currency: "",
                            isMaster: ""
                        }]
                    }
                    if(!info.businessFinanceDatas.length){
                        info.businessFinanceDatas = [{
                            bankId: "",
                            creditLine: '',
                            guaranteeMethod: "",
                            loanMoney: '',
                            loanProductName: "",
                            loanRate: '',
                            rangeTime: "",
                        }]
                    }
                    if(!info.linkCompanyDatas.length){
                        info.linkCompanyDatas = [{
                            businessScope:"",
                            companyName:"",
                            linkType: ""
                        }]
                    }
                    if(!info.mainCompositionDatas.length){
                        info.mainCompositionDatas = [{
                            lastYearIncome:  "",
                            lastYearIncomeRate:  "",
                            productName: "",
                            questionYear: "",
                            thisYearIncome:  "",
                            thisYearIncomeRate:  "",
                        }]
                    }
                    if(!info.mainCustomerDatas.length){
                        info.mainCustomerDatas = [
                            {
                                customerName: "",
                                lastSalesIncome: "",
                                lastSalesIncomeRate: "",
                                productName: "",
                                thisSalesIncome: ""
                            }
                        ]
                    }
                    if(!info.mainOrderDatas.length){
                        info.mainOrderDatas = [
                            {
                                buyerName: "",
                                contractPrice: '',
                                memo: "",
                                signTime: "",
                            }
                        ]
                    }
                    if(!info.mainSupplierDatas.length){
                        info.mainSupplierDatas = [
                            {
                                lastSupplyIncome:'',
                                lastSupplyIncomeRate: '',
                                productName: "",
                                supplierName: "",
                                thisSupplyIncome: ''
                            }
                        ]
                    }
                    if(!info.quesCashData){
                        info.quesCashData={
                            applyMoney: '',
                            applyUseInfo: "",
                            moneyRequestInfo: "",
                            paymentInfo: ""
                         }
                    }
                     this.information = info
                     console.log(info,'EEEE')
                }else{
                    
                }
            })
        },
        tabClick(num,id){
            this.activeIndex = num;
            this.questionYear= id;
            this.information.questionYear= id;
            this.getDetail()
        },
        returnStr(str){
            let val;
            this.yearSelectArr.map((item)=>{
                if(item.key == str){
                    val = item.value
                }
            })  
            return val;
        },
        getYearList(){
            let  url = CONSTANT.URL.COMPANY.FINDUSERQUESTYEAR,
                data = {},
                dataForm = {}
                common.requestAjax(url,JSON.stringify(data),dataForm,(res)=>{
                if(res.status == 200){
                    this.yearArr= res.data.bussData;
                    let id = this.yearArr.length?this.yearArr[0].questionYear:''
                    this.questionYear= id;
                    this.information.questionYear= id;
                    this.getDetail()
                }else{
                    
                }
            })
        },
        getGuarantArr(){
            let  url = CONSTANT.URL.SYS.LOADDICTIONARY,
                data = {},
                dataForm = {codeType:'guarantee'}
                common.requestAjax(url,JSON.stringify(data),dataForm,(res)=>{
                if(res.status == 200){
                    this.guarantArr= res.data.bussData
                }else{
                
                }
            })
        },
        getLinkArr(){
            let  url = CONSTANT.URL.SYS.LOADDICTIONARY,
                data = {},
                dataForm = {codeType:'link_type'}
                common.requestAjax(url,JSON.stringify(data),dataForm,(res)=>{
                if(res.status == 200){
                    this.linkArr= res.data.bussData
                }else{
                
                }
            })
        },
        getBankArr(){
            let  url = CONSTANT.URL.SYS.LOADDICTIONARY,
                data = {},
                dataForm = {codeType:'first_bank'}
                common.requestAjax(url,JSON.stringify(data),dataForm,(res)=>{
                if(res.status == 200){
                    this.loanLoading = false;
                    this.bankArr= res.data.bussData
                }else{
                
                }
            })
        },
      showMarquee:function (num) {
          if (!this.messageList[0]) return
          this.messageList.push(this.messageList[0]);
          var max = this.messageList.length;
          var that = this;
          let marqueetimer =  setInterval(function(){
              num++;
              if(num>=max ){
                  num=0;
              }
              that.num=num*30;
          }, 2000);
      }

  },
  watch: {  
      $route(to, from) {  
        // this.$refs.left.activePath()
      }  
  }
}
</script>
<style>
   .col-content .el-form-item__error {
        top: 88%;
        left: 0%;
    }
</style>

<style  lang="scss" scoped>
    .message {
        display: block;
        position: relative;
        width: 60%;
        height: 30px;/*关键样式*/
        overflow: hidden;
    }
    .marquee_list{
        display: block;
        position: absolute;
        top:0;
        left: 0;
    }
    .marquee_top{transition: top 0.5s ;}/*关键样式*/
    .marquee_list li{
        height: 30px;/*关键样式*/
        line-height: 30px;/*关键样式*/
        font-size: 14px;
        padding-left: 20px;
        background-color: #fff;
        a {
            color: #333;
        }
    }
body{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
}
.el-form-item {
    margin-bottom:  0;
    display: inline-block;
}
.content{
  min-height: 100%;
  background-color: #f5f5f5;
  width: 81.3%;
  float: right;
}

.content-wrap{
  overflow: hidden;
}

.question-detail{
    header {
        margin: 19px 0;
        font-size: 14px;
        color: #333;
        a {
            color: #999;
        }
    }
    .focus-pointer {
        font-size: 14px;
        height: 70px;
        line-height: 70px;
        background-color: #fff;
        padding-left: 18px;
        white-space: nowrap;
    }
    
.list-wrapper {
    display: flex;
    border-left: 1px solid #d1d1d1;
}

.list-col {
    flex: 1;
    border-right: 1px solid #D1D1D1;
} 

.list-col>.col-header,
.list-col>.col-content {
    text-align: center;
    border-top: 1px solid #D1D1D1;
}

.list-col>.col-header {
    height: 35px;
    line-height: 35px;
    font-size: 14px;
    color: #888888;
}

.list-col>.col-content {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 15px;
}

.list-col>.col-content span {
    font-size: 14px;
}

.list-col.op {
    flex: none;
    width: 100px;
}

.list-col.op .btn {
    width: 60px;
    height: 30px;
    bottom: 20px;
    margin: auto;
    // margin-left: 41px;
    // margin-top: 30px;
    background-color: #ED7018;
    border-radius: 4px;
    -webkit-border-radius: 4px;
    font-size: 10px;
    color: #fff;
    text-align: center;
    line-height: 30px;
    cursor: pointer;
    &:hover{
        background-color: #ED9000;
        transition:all .2s linear
    } 
}

}
.question-wrap{
    margin-top: 30px;
    background-color: #fff;
    padding: 0 0 33px 26px;
          .tabs{
              overflow: hidden;
              font-size: 16px;
              color: #666;
              height: 55px;
              line-height: 55px;
              border-bottom: 1px solid #E1E1E1;
              .tab{
                  &:first-child{
                      padding-left: 0;
                  }
                  cursor: pointer;
                  float: left;
                  padding: 0 30px;
                  &.active{
                      color: #ED7018;
                  }
                  &:hover{
                      color: #ED7018;
                  }
              }
          }
          &.edit{

          }
          .question-infos{
              padding-right: 85px;
            .edit-btn{
                margin-top: 20px;
                width: 80px;
                height: 30px;
                background-color: #6C6C6C;
                border-radius: 4px;
                -webkit-border-radius: 4px;
                font-size: 16px;
                color: #fff;
                text-align: center;
                line-height: 30px;
                cursor: pointer;
                &:hover{
                    background-color: #555;
                    transition:all .2s linear
                } 
            }
            .infos{
                font-size: 14px;
                color: #666;
                padding-bottom: 20px;
                border-bottom: 1px solid #e1e1e1;
                .infos-title {
                    color: #F8B300;
                    font-size: 16px;
                    margin: 19px 0 26px;
                }
                .infos-list{
                    margin-top: 23px;
                    .el-input{
                        width: 300px;
                    }
                    span{
                        color: #111111;
                    }
                }
            }
            .submit-btn{
                    width:80px;
                    height: 40px;
                    bottom: 20px;
                    margin: 20px auto;
                    // margin-left: 41px;
                    // margin-top: 30px;
                    background-color: #ED7018;
                    border-radius: 4px;
                    -webkit-border-radius: 4px;
                    font-size: 14px;
                    color: #fff;
                    text-align: center;
                    line-height: 40px;
                    cursor: pointer;
                    &:hover{
                        background-color: #ED9000;
                        transition:all .2s linear
                    } 
            }
            .table-list{
                position: relative;
                border-bottom: 1px solid #e1e1e1;
                .table-title{
                    font-size: 16px;
                    color: #F8B300;
                    padding-top: 25px;
                    margin-bottom: 19px;
                }
                .list-wrap{
                    border: 1px black solid;
                    border-color: #E1E1E1;
                    border-bottom: 0px;
                    /*display: table;*/
                    .p10{
                        width:10%!important;
                    }
                    .p20{
                        width:20%!important;
                    }
                    .p15{
                        width:15%!important;
                    }
                    .p18{
                        width:18%!important;
                    }
                    .p30{
                        width:30%!important;
                    }
                    .p40{
                        width:40%!important;
                    }
                    .p50{
                        width:50%!important;
                    }
                    .p60{
                        width:60%!important;
                    }
                    .list-info{
                        position: relative;
                        overflow: hidden;
                        display: table;
                        width: 100%;
                        min-height: 50px;
                        // padding-bottom: 20px;
                        .list-value{
                            /*float: left;*/
                            display: table-cell;
                            width:20%;
                            border-style: solid;
                            border-color: #E1E1E1;
                            border-width: 0px 1px 0px 0px;
                            padding-left: 10px;
                            padding-top: 15px;
                            padding-bottom: 15px;
                            word-break: break-all;
                            word-wrap:break-word;
                            // margin-right: 20px;
                            // margin-top: 30px;
                            font-size: 14px;
                            color: #323232;
                            
                            .el-input{
                                width: 80%;
                            }
                            .el-select{
                                width: 80%;
                            }
                        }
                        .list-value:nth-last-child(1) {
                            border-width: 0px;
                        }

                    }
                    .btn{
                        position: absolute;
                        right: -80px;
                        width: 73px;
                        height: 40px;
                        bottom: 16px;
                        // margin-left: 41px;
                        // margin-top: 30px;
                        background-color: #ED7018;
                        border-radius: 4px;
                        -webkit-border-radius: 4px;
                        font-size: 14px;
                        color: #fff;
                        text-align: center;
                        line-height: 40px;
                        cursor: pointer;
                        &:hover{
                            background-color: #ED9000;
                            transition:all .2s linear
                        } 
                    }
                    .list-names{
                        color: #666;
                        overflow: hidden;
                        border-style: solid;
                        border-color: #E1E1E1;
                        border-width: 0px 0px 1px 0px;
                        display: table;
                        width: 100%;
                        .list-name{
                            display: table-cell;
                            /*float: left;*/
                            width:20%;
                            border-style: solid;
                            border-color: #E1E1E1;
                            border-width: 0px 1px 0px 0px;
                            padding-left: 10px;
                            padding-top: 15px;
                            padding-bottom: 15px;
                            // margin-right: 20px;
                        }
                        .list-name:nth-last-child(1) {
                            border-width: 0px;
                        }
                    }
                }
            }
          }
      }

a{
  text-decoration: none;
}
</style>